import axios from 'axios';
import {loginreq, req} from './axiosFun';

// 登录接口
export const login = (params) => { return loginreq("post", "/api/login", params) };
// 获取用户菜单
export const menu = (params) => { return axios.get("/api/menu?&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
// 退出接口
export const loginout = () => { return axios.delete("/api/login?&token=" + localStorage.getItem('logintoken')).then(res => res.data) };

/**
 * 用户管理
 **/
// 用户管理-获取用户列表
export const userList = (params) => { return req("post", "/user/selectObject", params) };
// 用户管理-保存（添加编辑）
export const userSave = (params) => { return req("post", "/user/insertOrUpadte", params) };
// 用户管理-删除用户
export const userDelete = (params) => { return req("post","/user/delete",params) };
/**
 * 体育馆管理
 **/
// 用户管理-获取用户列表
export const gymList = (params) => { return req("post", "/gymnasium/selectObject", params) };
// 用户管理-保存（添加编辑）
export const gymSave = (params) => { return req("post", "/gymnasium/insertOrUpadte", params) };
// 用户管理-删除用户
export const gymDelete = (params) => { return req("post","/gymnasium/delete",params) };
/**
 * 公司管理
 **/
// 获取公司列表
export const siteList = (params) => { return req("post", "/site/selectObject", params) };
// 保存（添加编辑）
export const siteSave = (params) => { return req("post", "/site/insertOrUpadte", params) };
// 删除公司
export const siteDelete = (params) => { return req("post","/site/delete",params) };


// 会员列表
export const gymMemberList = (params) => { return req("post", "/gymMember/selectObject", params) };
// 保存（添加编辑）
export const gymMemberSave = (params) => { return req("post", "/gymMember/insertOrUpadte", params) };
// 删除公司
export const gymMemberDelete = (params) => { return req("post","/gymMember/delete",params) };
// 优惠券管理
export const couponList = (params) => { return req("get", "/coupon/selectAll", params)};
// 保存（添加编辑）
export const couponSave = (params) => { return req("post", "/coupon/insertOrUpadte", params)};
// 删除
export const couponDelete = (params) => { return req("post","/coupon/delete",params)};
// 活动管理
export const gymEventList = (params) => { return req("post", "/gymEvent/selectObject", params)};
// 保存（添加编辑）
export const gymEventSave = (params) => { return req("post", "/gymEvent/insertOrUpadte", params)};
// 删除
export const gymEventDelete = (params) => { return req("post","/gymEvent/delete",params)};
// 课程管理
export const gymCourseList = (params) => { return req("post", "/gymCourse/selectObject", params)};
// 保存（添加编辑）
export const gymCourseSave = (params) => { return req("post", "/gymCourse/insertOrUpadte", params)};
// 删除
export const gymCourseDelete = (params) => { return req("post","/gymCourse/delete",params)};
// 轮播图管理
export const imgInfoList = (params) => { return req("post", "/imgInfo/selectObject", params)};
// 保存（添加编辑）
export const imgInfoSave = (params) => { return req("post", "/imgInfo/insertOrUpadte", params)};
// 删除
export const imgInfoDelete = (params) => { return req("post","/imgInfo/delete",params)};
// 订单预约
export const indentList = (params) => { return req("post", "/indent/selectObject", params)};
// 保存（添加编辑）
export const indentSave = (params) => { return req("post", "/indent/insertOrUpadte", params)};
// 删除
export const indentDelete = (params) => { return req("post","/indent/delete",params)};
// 场地预约
export const venuereservationList = (params) => { return req("post", "/venuereservation/selectObject", params)};
// 保存（添加编辑）
export const venuereservationSave = (params) => { return req("post", "/venuereservation/insertOrUpadte", params)};
// 删除
export const venuereservationDelete = (params) => { return req("post","/venuereservation/delete",params)};
